Page({
  data: {
    userId: wx.getStorageSync("userId"),
    userName: wx.getStorageSync("userName")
  },
  onShow: function () {
    if (wx.getStorageSync("userId") !== '') {
      this.setData({
        userId: wx.getStorageSync("userId"),
        userName: wx.getStorageSync("userName")
      })
    }
  },
  login: function () {
    //登录
    wx.navigateTo({ url: "../login/login" })
  },
  notice:function () {
    //通知
    wx.navigateTo({ url: "pages/notice/notice" })
  },
  cardBag: function () {
    //我的卡包
    wx.navigateTo({ url: "pages/cardBag/cardBag" })
  },
  exit: function () {
    //退出
    wx.clearStorageSync();
    this.setData({
      userId:'',
      userName: ''
    })
  }
})